cmake_minimum_required(VERSION 3.16)
project(ffmpeg_learn C)

set(CMAKE_C_STANDARD 11)
set(SRC_DIR ./src)

include_directories(include/)
link_directories(lib/)

set(SOURCE_FILES
        ${SRC_DIR}/gen_pic.c)
#        ${SRC_DIR}/encode_video.c
#        ${SRC_DIR}/cut.c
#        ${SRC_DIR}/remux.c
#        ${SRC_DIR}/extra_video.c
#        ${SRC_DIR}/extra_audio.c
#        ${SRC_DIR}/ff_dir.c
#        ${SRC_DIR}/ff_io.c
#        ${SRC_DIR}/ffmpeg_log.c
#        ${SRC_DIR}/ff_log.c
#        ${SRC_DIR}/mediainfo.c
#        ${SRC_DIR}/main.c
#        ${SRC_DIR}/file_test.c
#        src/encode_audio.c
#        )

#file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
#foreach (file ${files})
#    get_filename_component(name ${file} NAME)
#    add_executable(${name} ${file})
#endforeach ()

add_executable(ffmpeg_learn
        ${SOURCE_FILES})

target_link_libraries(
        ffmpeg_learn
        avformat.61
        avcodec.61
        avdevice.61
        avfilter.10
        avutil.59
        postproc.58
        swresample.5
        swscale.8
)